var app = angular.module('AppModule', ['ngRoute', 'utk.directive', 'utk.directive.chart']);

app.constant('appRoute', {
    'Home': { name: 'Home', path: '#/Home', templateUrl: 'html/home.html', controller: 'HomeCtrl' },
    
    'About': { name: 'About', path: '#/About', templateUrl: 'html/About.html', controller: "AboutCtrl" }
});

app.value('menu', function (appRoute) {
    return [
        appRoute['Home'],
        {
            name: 'Management',
            dropdown: [
                //appRoute['Monitor']
            ]
        },
        {
            name: 'Help',
            dropdown: [
                appRoute['About']
            ]
        }
    ];
});

app.config(function ($routeProvider, appRoute) {
    for(var k in appRoute) {
        var r = appRoute[k];
        $routeProvider.when(r.path.substr(1), {templateUrl: r.templateUrl, controller: r.controller});
    }
    $routeProvider.otherwise({ redirectTo: "/Home" });
})
